﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Studio.Foundation.Json.Core;
using Studio.Foundation.Json.Core.Conversion;

public partial class JsonConvert_IJsonStructures : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        A a = new A();
        a.list.Add("jobs");
        a.list.Add("do");

        string s = JsonConvert.ExportToString(a);
        Response.Write(s);
    }

    public class A : IEnumerable<string>
    {
        public int i = 3;
        public string s = "hello";

        public IList<string> list = new List<string>();

        public IEnumerator<string> GetEnumerator()
        {
            return this.list.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this.list.GetEnumerator();
        }
    }
}